﻿using System;
using System.Collections.Generic;
using System.Web;

/// <summary>
///LoginBase 的摘要说明
/// </summary>
public class LoginBase : Base
{

    private string sessionKey = "user";
    private Model.User _user = new Model.User();

    public Model.User User
    {
        set { Session[sessionKey] = value; }
        get { ValidateSession(); return _user; }
    }

    public override void ValidateSession()
    {
        if (Session[sessionKey] == null)
        {
            Response.Redirect("/user/login.aspx");
        }
        else
        {
            _user = Session[sessionKey] as Model.User;
        }
    }
}